import { onMounted, ref } from 'vue';
import * as api from '../api/dict';
import { get } from 'lodash'

export function useDict(dictId) {
  const dicts = ref(null);

  onMounted(() => {
    const params = { dictId }
    api.queryDictItemList(params).then(({ data }) => {
      dicts.value = get(data, 'data.records');
    })
  })

  return dicts;

}

